import QtQuick 2.12
import QtQuick.Window 2.12
import QtLocation 5.12
import QtPositioning 5.12

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("YCLocation")

    Component.onCompleted: {
        console.log(_map.supportedMapTypes[0].name)
        _map.activeMapType = _map.supportedMapTypes[0]
    }

    Map {
        id: _map
        anchors.fill: parent
        gesture.acceptedGestures:   MapGestureArea.PinchGesture | MapGestureArea.PanGesture | MapGestureArea.FlickGesture
        gesture.flickDeceleration:  3000
        minimumZoomLevel: 3
        maximumZoomLevel: 20
        zoomLevel: 10
        center: QtPositioning.coordinate(30.67, 104.06) // 成都位置
        plugin: Plugin { 
            name: "YCLocationProvider"
            // 添加密钥
//            PluginParameter {
//                name: "apiKey"
//                value: "YOUR_ACTUAL_API_KEY_HERE"
//            }
        }
    }

}